using System;
using Seagull.Generic;
using Seagull.Model;

namespace Seagull.Shell.Views
{
    internal abstract class ChannelFrameSetProvider
    {
        public event EventHandler<NewFramesEventArgs> NewFrames;

        protected virtual void OnNewFrames(NewFramesEventArgs e)
        {
            var handler = NewFrames;
            if (handler != null)
                handler(this, e);
        }

        public event EventHandler<EventArgs<Exception>> Error;

        protected virtual void OnError(object sender, EventArgs<Exception> e)
        {
            var handler = Error;
            if (handler != null) handler(sender, e);
        }
    }

    internal class NewFramesEventArgs : EventArgs
    {
        public Tuple<byte, FrameSet>[] ChannelFrames { get; set; }
    }
}